{{#extends @html/widgets/widget.html}}
{{:widget_div_name}}popular{{/:widget_div_name}}

{{:widget_body}}
	{{?widget.tdi_not_found}}
		<div class="content"><p>Виджет не настроен.</p></div>
	{{?:}}
		{{?!widget.content.items}}
			<div class="content"><p>Записей пока нет.</p></div>
		{{?:}}
			<div class="list-">
				{{!for widget.content.items do=@:pp_item}}
				{{:pp_item}}<div class="item-"><a href="{{/}}{{community.url}}/{{*item_oid}}" class="s{{*tdi_color}}-link">{{*item_title}}</a> <span class="comments-">{{*comments_count}}</span></div>{{/:pp_item}}
			</div>
		{{/?}}
	{{/?}}
{{/:widget_body}}

{{:settings}}
<div class="popup-widgets" id="settings_container">
	<form action="" id="settingsform">
	<input type="hidden" name="widget_id" value="{{settings.id}}" id="widget_id" />
	<h2 class="title-">Популярные записи</h2>
	<div class="content-">
		<fieldset class="fieldset- count- select-">
			<label>Количество записей</label>
			<select name="items_count">
				<option value="3" {{?settings.items_count==3}}selected{{/?}}>3 записи</option>
				<option value="4" {{?settings.items_count==4}}selected{{/?}}>4 записи</option>
				<option value="5" {{?settings.items_count==5}}selected{{/?}}>5 записей</option>
				<option value="6" {{?settings.items_count==6}}selected{{/?}}>6 записей</option>
				<option value="7" {{?settings.items_count==7}}selected{{/?}}>7 записей</option>
				<option value="8" {{?settings.items_count==8}}selected{{/?}}>8 записей</option>
				<option value="9" {{?settings.items_count==9}}selected{{/?}}>9 записей</option>
				<option value="10" {{?settings.items_count==10}}selected{{/?}}>10 записей</option>
			</select>
		</fieldset>
		<fieldset class="fieldset- checkboxes-">
			<label for="directory00"><span class="root-"><input type="checkbox" id="directory00" name="tdis[]" value="*"/>Все</span>Разделы</label>
			<ul class="list-">
				{{!for settings.tdis do=@:tdi_checkbox}}
				{{:tdi_checkbox}}
				<li><input type="checkbox" id="directory_{{*oid}}" {{?*checked}}checked="checked"{{/?}} name="tdis[]" value="{{*oid}}"/><label for="directory_{{*oid}}">{{*title}}</label></li>
				{{/:tdi_checkbox}}
			</ul>
			{{?widget.ui_frontjs}}
			<a href="{{/}}{{widget.ui_frontjs}}" id="frontjs{{widget.widget_id}}"></a>
			{{/?}}
			{{?community.acl.community_edit.is_allowed}}
			<a href="{{/}}{{widget.ui_settingsjs}}" id="setjs{{widget.widget_id}}"></a>
			{{/?}}
		</fieldset>
	</div>
	{{@:settingsbutton}}
	</form>
</div>
{{/:settings}}
